﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using QuocTeViet.DO;
using QuocTeViet.BL;

namespace QuocTeViet
{
    public partial class About : System.Web.UI.Page
    {
        cmsCategoryDO objCat = new cmsCategoryDO();
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dtConten = new DataTable("dtConten");
            int CategoryID = int.Parse(Request.QueryString["ID"].ToString());
            objCat.CategoryID = CategoryID;
            if (!IsPostBack)
            {
                objCat = new cmsCategoryBL().Select(objCat);
                dtConten = new cmsCategoryBL().SelectOne(objCat);
                if ((dtConten.Rows.Count > 0) && (dtConten != null))
                {
                    Page.Title = dtConten.Rows[0]["Title"].ToString();
                    lblTitle.Text = dtConten.Rows[0]["Title"].ToString();
                    rptNews.DataSource = dtConten;
                    rptNews.DataBind();
                }
                else
                {
                    Page.Title = "Quốc tế việt";
                    lblTitle.Text = "Trang web đang cập nhật nội dung";
                }
            }
        }
        protected string FriendlyUrl(string strTitle)
        {
            return Ultility.Change_AV(strTitle);
        }
    }
}
